package com.basic.common.area;

import org.apache.logging.log4j.util.Strings;

/**
 * @author 
 */
public class AreaDsUtil {

    private static String SHIXIAQU = "/市辖区";
    private static String SHIXIAQU_2 = "/市辖区/";
    private static String SHI = "/市";
    private static String SHI_2 = "/市/";
    private static String XIAN = "/县";
    private static String XIAN_2 = "/县/";

    public static String cutAreaFullName(String areaFullName) {
        if (Strings.isBlank(areaFullName)) {
            return areaFullName;
        }
        if (areaFullName.contains(SHIXIAQU)) {
            areaFullName = areaFullName.replaceAll(SHIXIAQU_2,"").replaceAll(SHIXIAQU,"");
        } else if (areaFullName.contains(SHI)) {
            areaFullName = areaFullName.replaceAll(SHI_2,"").replaceAll(SHI,"");
        } else if (areaFullName.contains(XIAN)) {
            areaFullName = areaFullName.replaceAll(XIAN_2, "").replaceAll(XIAN, "");
        }
        return areaFullName;
    }

}
